﻿using System;
using System.Drawing;
using MUnit;

namespace Maze
{
    class TestDumbEnemy
    {
        SQ[,] squares = { { SQ.O, SQ.O },
                          { SQ.W, SQ.O }};
        Board board;

        [Setup]
        void Setup()
        {
            // This will be run once before each test method
            board = new Board(this.squares);
        }

        [Test]
        void Move()
        {
            Point start = new Point(0, 0);
            Point wayPoint = new Point(1, 0);
            Point turnAt = new Point(1, 1);
            PathFinder pathFinder = new PathFinder(this.board);
            DumbEnemy enemy = new DumbEnemy(start, pathFinder, turnAt);
            enemy.Update(1);
            Verify.Equals(wayPoint, MazeForm.PixelsToSquare(enemy.Location));
            enemy.Update(1);
            Verify.Equals(turnAt, MazeForm.PixelsToSquare(enemy.Location));
            enemy.Update(1);
            Verify.Equals(wayPoint, MazeForm.PixelsToSquare(enemy.Location));
            enemy.Update(1);
            Verify.Equals(start, MazeForm.PixelsToSquare(enemy.Location));
        }

        [TearDown]
        void TearDown()
        {
            // This will be run once after each test method
        }
    }
}
